﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Collections;

namespace ISUM_V2
{
	/// <summary>
	/// Interaction logic for CustomKeyboard.xaml
	/// </summary>
    /// 
    
	public partial class CustomKeyboard : Window
	{
        ArrayList MorseImage, SetImage, CustomButton, CurrentImage, CurrentButton;
        
        SerchEnableMorseCode SerchMorseCode;

        Image TempImage, SelectedImage;

        MorseCodeFileModule Mcfm;

        Button StyleButton;

        ScreenKeyboard _ScrKeyboard;

        ScreenMouse _ScrMouse;

        private UCOption _UcOption;

        bool IsCurrentKeyboardClick = false, IsMouse = false;

        public static bool _IsShow { get; set; }
        public CustomKeyboard()
		{
			this.InitializeComponent();

            
            DefaultInitialize();

            StyleButton = new Button();
            StyleButton.Style = Btn_KeyBoardView.Style;
            

            Btn_KeyBoardView_Click(null, null);
            //if (!IsMouse)
            //    InitailizeKeyBoard();
            //else
            //    InitailizeMouse();
        }

        public CustomKeyboard ( ScreenKeyboard screenKeyboard, ScreenMouse screenMouse, bool isKeyboard )
        {
            this.InitializeComponent();
            this.Closed += new EventHandler(CustomKeyboard_Closed);
            CustomKeyboard._IsShow = true;
            _ScrKeyboard = screenKeyboard;
            _ScrMouse = screenMouse;

            DefaultInitialize();

            StyleButton = new Button();
            StyleButton.Style = Btn_KeyBoardView.Style;

            

            if (isKeyboard)
            {
                Btn_KeyBoardView_Click( null, null );
            }
            else
            {
                Btn_MouseView_Click( null, null );
            }

            
            //if (obj is ScreenKeyboard)
            //{
            //    Btn_KeyBoardView_Click(null, null);
            //    _ScrKeyboard = (ScreenKeyboard)obj;
            //}
            //else
            //{
            //    Btn_MouseView_Click(null, null);
            //    _ScrMouse = (ScreenMouse)obj;
            //}
            ////if (!IsMouse)
            //    InitailizeKeyBoard();
            //else
            //    InitailizeMouse();
        }

        private void DefaultInitialize()
        {
            MorseImage = new ArrayList();
            SetImage = new ArrayList();
            CustomButton = new ArrayList();
            CurrentImage = new ArrayList();
            CurrentButton = new ArrayList();
            TempImage = new Image();
            SelectedImage = new Image();
            SerchMorseCode = new SerchEnableMorseCode();

            _UcOption = new UCOption(_ScrKeyboard, _ScrMouse);
            _UcOption.Height = 100;
            _UcOption.Width = 100;
            Canvas_Option.Children.Add(_UcOption);


            _UcOption.Btn_OptionSave.Click += new RoutedEventHandler(Btn_OptionSave_Click);
            _UcOption.Btn_OptionExit.Click += new RoutedEventHandler(Btn_OptionExit_Click);
           
			
            //ucOption.Btn_Save.Click += new RoutedEventHandler(Btn_Save_Click);
            //ucOption.Btn_Exit.Click += new RoutedEventHandler(Btn_Exit_Click);

            UC_Macro.Btn_OK.Click += new RoutedEventHandler( Btn_OK_Click );
            UC_Macro.Btn_Cancel.Click += new RoutedEventHandler( Btn_Cancel_Click );
            UC_Macro.Btn_Apply.Click += new RoutedEventHandler(UC_Macro_Btn_Apply_Click);
            
            this.rectBackgroundMain.MouseLeftButtonDown += new MouseButtonEventHandler( rectBackgroundMain_MouseLeftButtonDown );
            this.UC_Macro.MouseLeftButtonDown += new MouseButtonEventHandler( UC_Macro_MouseLeftButtonDown );
            

             

            #region CustomAddButtonEvent
            this.Closed += new EventHandler(CustomKeyboard_Closed);
			Btn_Exit.Click +=new System.Windows.RoutedEventHandler(Btn_Exit_Click);
            Btn_KeyBoardView.Click += new RoutedEventHandler(Btn_KeyBoardView_Click);
            Btn_MouseView.Click += new RoutedEventHandler(Btn_MouseView_Click);
            Btn_MacroView.Click += new RoutedEventHandler(Btn_MacroView_Click);
            Btn_OptionView.Click += new RoutedEventHandler(Btn_OptionView_Click);

            Btn_iniEnglish.Click += new RoutedEventHandler(Btn_iniEnglish_Click);
            Btn_iniKorean.Click += new RoutedEventHandler(Btn_iniKorean_Click);
            Btn_Apply.Click += new RoutedEventHandler(Btn_Apply_Click);
            Btn_Save.Click += new RoutedEventHandler(Btn_Save_Click);
            Btn_0.Click += new RoutedEventHandler(Btn_0_Click);
            Btn_1.Click += new RoutedEventHandler(Btn_1_Click);
            Btn_2.Click += new RoutedEventHandler(Btn_2_Click);
            Btn_3.Click += new RoutedEventHandler(Btn_3_Click);
            Btn_4.Click += new RoutedEventHandler(Btn_4_Click);
            Btn_5.Click += new RoutedEventHandler(Btn_5_Click);
            Btn_6.Click += new RoutedEventHandler(Btn_6_Click);
            Btn_7.Click += new RoutedEventHandler(Btn_7_Click);
            Btn_8.Click += new RoutedEventHandler(Btn_8_Click);
            Btn_9.Click += new RoutedEventHandler(Btn_9_Click);
            Btn_10.Click += new RoutedEventHandler(Btn_10_Click);
            Btn_11.Click += new RoutedEventHandler(Btn_11_Click);
            Btn_12.Click += new RoutedEventHandler(Btn_12_Click);
            Btn_13.Click += new RoutedEventHandler(Btn_13_Click);
            Btn_14.Click += new RoutedEventHandler(Btn_14_Click);
            Btn_15.Click += new RoutedEventHandler(Btn_15_Click);
            Btn_16.Click += new RoutedEventHandler(Btn_16_Click);
            Btn_17.Click += new RoutedEventHandler(Btn_17_Click);
            Btn_18.Click += new RoutedEventHandler(Btn_18_Click);
            Btn_19.Click += new RoutedEventHandler(Btn_19_Click);
            Btn_20.Click += new RoutedEventHandler(Btn_20_Click);
            Btn_21.Click += new RoutedEventHandler(Btn_21_Click);
            Btn_22.Click += new RoutedEventHandler(Btn_22_Click);
            Btn_23.Click += new RoutedEventHandler(Btn_23_Click);
            Btn_24.Click += new RoutedEventHandler(Btn_24_Click);
            Btn_25.Click += new RoutedEventHandler(Btn_25_Click);
            Btn_26.Click += new RoutedEventHandler(Btn_26_Click);
            Btn_27.Click += new RoutedEventHandler(Btn_27_Click);
            Btn_28.Click += new RoutedEventHandler(Btn_28_Click);
            Btn_29.Click += new RoutedEventHandler(Btn_29_Click);
            Btn_30.Click += new RoutedEventHandler(Btn_30_Click);
            Btn_31.Click += new RoutedEventHandler(Btn_31_Click);
            Btn_32.Click += new RoutedEventHandler(Btn_32_Click);
            Btn_33.Click += new RoutedEventHandler(Btn_33_Click);
            Btn_34.Click += new RoutedEventHandler(Btn_34_Click);
            Btn_35.Click += new RoutedEventHandler(Btn_35_Click);
            Btn_36.Click += new RoutedEventHandler(Btn_36_Click);
            Btn_37.Click += new RoutedEventHandler(Btn_37_Click);
            Btn_38.Click += new RoutedEventHandler(Btn_38_Click);
            Btn_39.Click += new RoutedEventHandler(Btn_39_Click);
            Btn_40.Click += new RoutedEventHandler(Btn_40_Click);
            Btn_41.Click += new RoutedEventHandler(Btn_41_Click);
            Btn_42.Click += new RoutedEventHandler(Btn_42_Click);
            Btn_43.Click += new RoutedEventHandler(Btn_43_Click);
            Btn_44.Click += new RoutedEventHandler(Btn_44_Click);
            Btn_45.Click += new RoutedEventHandler(Btn_45_Click);
            Btn_46.Click += new RoutedEventHandler(Btn_46_Click);
            Btn_47.Click += new RoutedEventHandler(Btn_47_Click);
            Btn_48.Click += new RoutedEventHandler(Btn_48_Click);
            Btn_49.Click += new RoutedEventHandler(Btn_49_Click);
            Btn_50.Click += new RoutedEventHandler(Btn_50_Click);
            Btn_51.Click += new RoutedEventHandler(Btn_51_Click);
            Btn_52.Click += new RoutedEventHandler(Btn_52_Click);
            Btn_53.Click += new RoutedEventHandler(Btn_53_Click);
            Btn_54.Click += new RoutedEventHandler(Btn_54_Click);
            Btn_55.Click += new RoutedEventHandler(Btn_55_Click);
            Btn_56.Click += new RoutedEventHandler(Btn_56_Click);
            Btn_57.Click += new RoutedEventHandler(Btn_57_Click);
            Btn_58.Click += new RoutedEventHandler(Btn_58_Click);
            Btn_59.Click += new RoutedEventHandler(Btn_59_Click);
            Btn_60.Click += new RoutedEventHandler(Btn_60_Click);
            Btn_61.Click += new RoutedEventHandler(Btn_61_Click);
            #endregion
			
			Btn_CloseWindow.Click += new System.Windows.RoutedEventHandler(Btn_CloseWindow_Click);

            AddCustomMorseImageSrc();
            AddCustomButton();

            // 불러와서 꽂으면 되는곳


        }

        void Btn_OptionExit_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        void Btn_OptionSave_Click(object sender, RoutedEventArgs e)
        {
            _UcOption.SaveDefaultOption();
            _UcOption.SaveKeyboardOption();
            _UcOption.SaveMouseOption();

            _ScrKeyboard.LoadKeyboardOption();
            _ScrKeyboard.UpdateAutoCompleteText();
            _ScrMouse.SetMouseOption();
            _ScrMouse.LoadDefaultOption();
            this.Close();
        }

        void UC_Macro_Btn_Apply_Click( object sender, RoutedEventArgs e )
        {
            _ScrKeyboard.LoadMacro();
        }
          
            

        void UC_Macro_MouseLeftButtonDown ( object sender, MouseButtonEventArgs e )
        {
            DragMove();
        }

        void Btn_Cancel_Click ( object sender, RoutedEventArgs e )
        {
            this.Close();
        }

        void Btn_OK_Click ( object sender, RoutedEventArgs e )
        {
            UC_Macro.SaveMacro();
            
            _ScrKeyboard.LoadMacro();

            this.Close();

        }

        void rectBackgroundMain_MouseLeftButtonDown ( object sender, MouseButtonEventArgs e )
        {
            DragMove();
        }

       
        void CustomKeyboard_Closed(object sender, EventArgs e)
        {
            // 키보드 or 마우스 실행하기
            CustomKeyboard._IsShow = false;
        }

        void Btn_OptionView_Click(object sender, RoutedEventArgs e)
        {
            Btn_Focus.TabIndex = 25;
            IsCurrentKeyboardClick = false;

            textPreviewLong.Text = null;
            textPreview.Text = null;
            Btn_PreView.Style = Btn_PreView.Style;

            Btn_OptionView.Opacity = 1;
            Btn_MacroView.Opacity = 0.5;
            Btn_MouseView.Opacity = 0.5;
            Btn_KeyBoardView.Opacity = 0.5;
            MacroViewbox.Visibility = Visibility.Hidden;
            OptionViewbox.Visibility = Visibility.Visible;
            CustomCanvas.Visibility = Visibility.Hidden;
            KeyBoardViewbox.Visibility = Visibility.Hidden;
            MouseViewbox.Visibility = Visibility.Hidden;

            Btn_Focus.Visibility = Visibility.Hidden;
        }

        void Btn_MacroView_Click(object sender, RoutedEventArgs e)
        {
            Btn_Focus.TabIndex = 25;
            IsCurrentKeyboardClick = false;

            textPreviewLong.Text = null;
            textPreview.Text = null;
            Btn_PreView.Style = Btn_PreView.Style;

            Btn_OptionView.Opacity = 0.5;
            Btn_MacroView.Opacity = 1;
            Btn_MouseView.Opacity = 0.5;
            Btn_KeyBoardView.Opacity = 0.5;

            MacroViewbox.Visibility = Visibility.Visible;
            OptionViewbox.Visibility = Visibility.Hidden;
            CustomCanvas.Visibility = Visibility.Hidden;
            KeyBoardViewbox.Visibility = Visibility.Hidden;
            MouseViewbox.Visibility = Visibility.Hidden;

            Btn_Focus.Visibility = Visibility.Hidden;

            UC_Macro.LoadMacro();

           
        }

        void Btn_MouseView_Click(object sender, RoutedEventArgs e)
        {

            IsCurrentKeyboardClick = false;

            textPreviewLong.Text = "";
            textPreview.Text = "";
            Btn_PreView.Style = Btn_PreView.Style;
            imgPreView.Source = null;
            Btn_Focus.TabIndex = 25;

            imgPreView.Source = null;
            Canvas.SetTop(textPreview, 108);
            Btn_OptionView.Opacity = 0.5;
            Btn_MacroView.Opacity = 0.5;
            Btn_MouseView.Opacity = 1;
            Btn_KeyBoardView.Opacity = 0.5;
            IsMouse = true;

            MacroViewbox.Visibility = Visibility.Hidden;
            OptionViewbox.Visibility = Visibility.Hidden;
            CustomCanvas.Visibility = Visibility.Visible;
            Btn_Focus.Visibility = Visibility.Visible;

            InitailizeMouse();

            
            
        }
        
        void Btn_KeyBoardView_Click(object sender, RoutedEventArgs e)
        {
            
            IsCurrentKeyboardClick = false;

            textPreviewLong.Text = "";
            textPreview.Text = "";
            Btn_PreView.Style = Btn_PreView.Style;
            imgPreView.Source = null;
            Btn_Focus.TabIndex = 25;

            Btn_OptionView.Opacity = 0.5;
            Btn_MacroView.Opacity = 0.5;
            Btn_MouseView.Opacity = 0.5;
            Btn_KeyBoardView.Opacity = 1;
            IsMouse = false;

            MacroViewbox.Visibility = Visibility.Hidden;
            OptionViewbox.Visibility = Visibility.Hidden;
            CustomCanvas.Visibility = Visibility.Visible;
            Btn_Focus.Visibility = Visibility.Visible;

            InitailizeKeyBoard();
        }

        void Btn_Save_Click(object sender, RoutedEventArgs e)
        {
            SaveMorseImage();
            this.Close();
        }

        void Btn_Apply_Click(object sender, RoutedEventArgs e)
        {
            SaveMorseImage();
        }

        private void SaveMorseImage()
        {
            if (!this.IsMouse)
            {
                AddKeyBoardCurrentImageSrc();
                SerchMorseCode.SearchOverlapMorseCodeImage();
                SerchMorseCode.SearchEnableMorseCodeImage();

                SerchMorseCode.Save(MainWindow.GetDoubleParent() + "/SrzMoreseCode/Keyboard.data", this.IsMouse);

                _ScrKeyboard.InitMorseImage();
                _ScrKeyboard.InitCustomSignal();
            }
            else
            {
                AddMouseCurrentImageSrc();
                SerchMorseCode.SearchOverlapMorseCodeImage();
                SerchMorseCode.SearchEnableMorseCodeImage();

                SerchMorseCode.Save(MainWindow.GetDoubleParent() + "/SrzMoreseCode/Mouse.data", this.IsMouse);
                _ScrMouse.InitMorseImage();
                _ScrMouse.InitCustomSignal();
            }
        }



        void Btn_iniKorean_Click(object sender, RoutedEventArgs e)
        {
			Btn_Focus.TabIndex = 25;
            IsCurrentKeyboardClick = false;

            textPreviewLong.Text = null;
            textPreview.Text = null;
            Btn_PreView.Style = Btn_PreView.Style;
			
            if (!this.IsMouse)
            {
                SerchMorseCode.IniKorean(this.CurrentImage);
                AddKeyBoardCurrentImageSrc();
                SerchMorseCode.SearchOverlapMorseCodeImage();
                SerchMorseCode.SearchEnableMorseCodeImage();
            }
            else
            {
                SerchMorseCode.IniMouse( this.CurrentImage);
                AddMouseCurrentImageSrc();
                SerchMorseCode.SearchOverlapMorseCodeImage();
                SerchMorseCode.SearchEnableMorseCodeImage();
            }
        }

        void Btn_iniEnglish_Click(object sender, RoutedEventArgs e)
        {
            
        }

        private void InitailizeKeyBoard()
        {
            KeyBoardViewbox.Visibility = Visibility.Visible;
            MouseViewbox.Visibility = Visibility.Hidden;

            #region AddKeyBoardEvent
            Btn_A.Click += new RoutedEventHandler(Btn_A_Click);
            Btn_Alt.Click += new RoutedEventHandler(Btn_Alt_Click);
            Btn_AutoComplete.Click += new RoutedEventHandler(Btn_AutoComplete_Click);
            Btn_B.Click += new RoutedEventHandler(Btn_B_Click);
            Btn_Back.Click += new RoutedEventHandler(Btn_Back_Click);
            Btn_C.Click += new RoutedEventHandler(Btn_C_Click);
            Btn_CapsLock.Click += new RoutedEventHandler(Btn_CapsLock_Click);
            Btn_Close.Click += new RoutedEventHandler(Btn_Close_Click);
            Btn_Comma.Click += new RoutedEventHandler(Btn_Comma_Click);
            Btn_Ctrl.Click += new RoutedEventHandler(Btn_Ctrl_Click);
            Btn_D.Click += new RoutedEventHandler(Btn_D_Click);
            Btn_Delete.Click += new RoutedEventHandler(Btn_Delete_Click);
            Btn_Dot.Click += new RoutedEventHandler(Btn_Dot_Click);
            Btn_Down.Click += new RoutedEventHandler(Btn_Down_Click);
            Btn_E.Click += new RoutedEventHandler(Btn_E_Click);
            Btn_End.Click += new RoutedEventHandler(Btn_End_Click);
            Btn_Enter.Click += new RoutedEventHandler(Btn_Enter_Click);
            Btn_Esc.Click += new RoutedEventHandler(Btn_Esc_Click);
            Btn_F.Click += new RoutedEventHandler(Btn_F_Click);
            Btn_Function.Click += new RoutedEventHandler(Btn_Function_Click);
            Btn_G.Click += new RoutedEventHandler(Btn_G_Click);
            Btn_H.Click += new RoutedEventHandler(Btn_H_Click);
            Btn_HanEng.Click += new RoutedEventHandler(Btn_HanEng_Click);
            Btn_Hanja.Click += new RoutedEventHandler(Btn_Hanja_Click);
            Btn_Home.Click += new RoutedEventHandler(Btn_Home_Click);
            Btn_I.Click += new RoutedEventHandler(Btn_I_Click);
            Btn_Insert.Click += new RoutedEventHandler(Btn_Insert_Click);
            Btn_J.Click += new RoutedEventHandler(Btn_J_Click);
            Btn_K.Click += new RoutedEventHandler(Btn_K_Click);
            Btn_L.Click += new RoutedEventHandler(Btn_L_Click);
            Btn_Left.Click += new RoutedEventHandler(Btn_Left_Click);
            Btn_M.Click += new RoutedEventHandler(Btn_M_Click);
            Btn_Macro.Click += new RoutedEventHandler(Btn_Macro_Click);
            Btn_N.Click += new RoutedEventHandler(Btn_N_Click);
            Btn_Number.Click += new RoutedEventHandler(Btn_Number_Click);
            Btn_O.Click += new RoutedEventHandler(Btn_O_Click);
            Btn_Option.Click += new RoutedEventHandler(Btn_Option_Click);
            Btn_P.Click += new RoutedEventHandler(Btn_P_Click);
            Btn_PageDown.Click += new RoutedEventHandler(Btn_PageDown_Click);
            Btn_PageUp.Click += new RoutedEventHandler(Btn_PageUp_Click);
            Btn_PreView.Click += new RoutedEventHandler(Btn_PreView_Click);
            Btn_Q.Click += new RoutedEventHandler(Btn_Q_Click);
            Btn_R.Click += new RoutedEventHandler(Btn_R_Click);
            Btn_Recycle.Click += new RoutedEventHandler(Btn_Recycle_Click);
            Btn_Right.Click += new RoutedEventHandler(Btn_Right_Click);
            Btn_S.Click += new RoutedEventHandler(Btn_S_Click);
            Btn_Shift.Click += new RoutedEventHandler(Btn_Shift_Click);
            Btn_Space.Click += new RoutedEventHandler(Btn_Space_Click);
            Btn_T.Click += new RoutedEventHandler(Btn_T_Click);
            Btn_Tab.Click += new RoutedEventHandler(Btn_Tab_Click);
            Btn_U.Click += new RoutedEventHandler(Btn_U_Click);
            Btn_Up.Click += new RoutedEventHandler(Btn_Up_Click);
            Btn_V.Click += new RoutedEventHandler(Btn_V_Click);
            Btn_W.Click += new RoutedEventHandler(Btn_W_Click);
            Btn_Win.Click += new RoutedEventHandler(Btn_Win_Click);
            Btn_WindowSize.Click += new RoutedEventHandler(Btn_WindowSize_Click);
            Btn_X.Click += new RoutedEventHandler(Btn_X_Click);
            Btn_Y.Click += new RoutedEventHandler(Btn_Y_Click);
            Btn_Z.Click += new RoutedEventHandler(Btn_Z_Click);
            #endregion



            AddKeyBoardCurrentImageSrc();
            AddKeyBoardCurrentImage();
            AddKeyBoardCurrentButton();
           
            /* 이미지 불러오기 */
            ////////////////////////////////////

            Mcfm = MorseCodeFileModule.getInstance(); // 파일모듈 인스턴스 불러오고

            SrzKeyboard srzKeyboard = (SrzKeyboard)Mcfm.readFile(MainWindow.GetDoubleParent() + "/SrzMoreseCode/Keyboard.data"); // 역직렬화

            Image tempImage = null; //  템프 이미지 변수

            for (int i = 0; i < CurrentImage.Count; i++)
            {
                tempImage = (Image)CurrentImage[i];
                tempImage.Source = new BitmapImage(new Uri((string)srzKeyboard.ArrKeyBoardCustomMorseCodeSrc[i]));
            }
            /////////////////////////////////////


            

            SerchMorseCode.SearchOverlapMorseCodeImage();
            SerchMorseCode.SearchEnableMorseCodeImage();
        }

        

        private void InitailizeMouse()
        {
            KeyBoardViewbox.Visibility = Visibility.Hidden;
            MouseViewbox.Visibility = Visibility.Visible;

            #region AddMouseEvent
			Btn_OptionMorseMouse.Click += new System.Windows.RoutedEventHandler(Btn_OptionMorseMouse_Click);
            Btn_BackMainMouse.Click += new RoutedEventHandler(Btn_BackMainMouse_Click);
            Btn_DevideMouse.Click += new RoutedEventHandler(Btn_DevideMouse_Click);
            Btn_DownMouse.Click += new RoutedEventHandler(Btn_DownMouse_Click);
            Btn_DragMouse.Click += new RoutedEventHandler(Btn_DragMouse_Click);
            Btn_LeftClickMouse.Click += new RoutedEventHandler(Btn_LeftClickMouse_Click);
            Btn_LeftDoubleClickMouse.Click += new RoutedEventHandler(Btn_LeftDoubleClickMouse_Click);
            Btn_LeftDownMouse.Click += new RoutedEventHandler(Btn_LeftDownMouse_Click);
            Btn_LeftMouse.Click += new RoutedEventHandler(Btn_LeftMouse_Click);
            Btn_LeftRightClickMouse.Click += new RoutedEventHandler(Btn_LeftRightClickMouse_Click);
            Btn_LeftUpMouse.Click += new RoutedEventHandler(Btn_LeftUpMouse_Click);
            Btn_OptionMouse.Click += new RoutedEventHandler(Btn_OptionMouse_Click);
            Btn_RecycleMouse.Click += new RoutedEventHandler(Btn_RecycleMouse_Click);
            Btn_RightClickMouse.Click += new RoutedEventHandler(Btn_RightClickMouse_Click);
            Btn_RightDoubleClickMouse.Click += new RoutedEventHandler(Btn_RightDoubleClickMouse_Click);
            Btn_RightDownMouse.Click += new RoutedEventHandler(Btn_RightDownMouse_Click);
            Btn_RightMouse.Click += new RoutedEventHandler(Btn_RightMouse_Click);
            Btn_RightUpMouse.Click += new RoutedEventHandler(Btn_RightUpMouse_Click);
            Btn_UpMouse.Click += new RoutedEventHandler(Btn_UpMouse_Click);
            Btn_WheelDownMouse.Click += new RoutedEventHandler(Btn_WheelDownMouse_Click);
            Btn_WheelUpMouse.Click += new RoutedEventHandler(Btn_WheelUpMouse_Click);

            Btn_ExpAddressMouse.Click += new RoutedEventHandler(Btn_ExpAddressMouse_Click);
            Btn_ExpBackMouse.Click += new RoutedEventHandler(Btn_ExpBackMouse_Click);
            Btn_ExpCloseMouse.Click += new RoutedEventHandler(Btn_ExpCloseMouse_Click);
            Btn_ExpDecreaseMouse.Click += new RoutedEventHandler(Btn_ExpDecreaseMouse_Click);
            Btn_ExpFavoriteMouse.Click += new RoutedEventHandler(Btn_ExpFavoriteMouse_Click);
            Btn_ExpIncreaseMouse.Click += new RoutedEventHandler(Btn_ExpIncreaseMouse_Click);
            Btn_ExpNewMouse.Click += new RoutedEventHandler(Btn_ExpNewMouse_Click);
            Btn_ExpNextMouse.Click += new RoutedEventHandler(Btn_ExpNextMouse_Click);
            Btn_ExpOptionMouse.Click += new RoutedEventHandler(Btn_ExpOptionMouse_Click);
            Btn_ExpRefleshMouse.Click += new RoutedEventHandler(Btn_ExpRefleshMouse_Click);
            Btn_ExpStartMouse.Click += new RoutedEventHandler(Btn_ExpStartMouse_Click);
            Btn_WindowSizeMouse.Click += new RoutedEventHandler(Btn_WindowSizeMouse_Click);
            #endregion

            AddMouseCurrentImageSrc();
            AddMouseCurrentImage();
            AddMouseCurrentButton();



            Mcfm = MorseCodeFileModule.getInstance(); // 파일모듈 인스턴스 불러오고

            SrzMouse srzMouse = (SrzMouse)Mcfm.readFile(MainWindow.GetDoubleParent() + "/SrzMoreseCode/Mouse.data"); // 역직렬화

            Image tempImage = null; //  템프 이미지 변수

            for (int i = 0; i < CurrentImage.Count; i++)
            {
                tempImage = (Image)CurrentImage[i];
                tempImage.Source = new BitmapImage(new Uri((string)srzMouse.ArrMouseCustomMorseCodeSrc[i]));
            }

            SerchMorseCode.SearchOverlapMorseCodeImage();
            SerchMorseCode.SearchEnableMorseCodeImage();
        }





        #region MouseEvent
        void Btn_WindowSizeMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_WindowSizeMouse.Style, imgChangeWindowSizeMouse, true);
        }

        void Btn_ExpOptionMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_ExpOptionMouse.Style, imgExpOptionMouse, true);
        }

        void Btn_ExpAddressMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_ExpAddressMouse.Style, imgExpAdressMouse, true);
        }

        void Btn_ExpStartMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_ExpStartMouse.Style, imgExpStartMouse, true);
        }

        void Btn_ExpRefleshMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_ExpRefleshMouse.Style, imgExpRefleshMouse, true);
        }

        void Btn_ExpNextMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_ExpNextMouse.Style, imgExpNextMouse, true);
        }

        void Btn_ExpNewMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_ExpNewMouse.Style, imgExpNewExpMouse, true);
        }

        void Btn_ExpIncreaseMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_ExpIncreaseMouse.Style, imgExpIncreaseMouse, true);
        }

        void Btn_ExpFavoriteMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_ExpFavoriteMouse.Style, imgExpFavoriteMouse, true);
        }

        void Btn_ExpDecreaseMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_ExpDecreaseMouse.Style, imgExpDecreaseMouse, true);
        }

        void Btn_ExpCloseMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_ExpCloseMouse.Style, imgExpColseMouse, true);
        }

        void Btn_ExpBackMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_ExpBackMouse.Style, imgExpBackMouse, true);
        }
        
        /// <summary>
        /// /////////////////////////////////////
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        void Btn_DragMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_DragMouse.Style, imgDragMouse, true);
        }

        void Btn_BackMainMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_BackMainMouse.Style, imgBackMainMouse, true);
        }

        void Btn_DownMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_DownMouse.Style, imgDownMouse, true);
        }

        void Btn_DevideMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_DevideMouse.Style, imgDevideMouse, true);
        }

        void Btn_WheelUpMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_WheelUpMouse.Style, imgWheelUpMouse, true);
        }

        void Btn_WheelDownMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_WheelDownMouse.Style, imgWheelDownMouse, true);
        }

        void Btn_UpMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_UpMouse.Style, imgUpMouse, true);
        }

        void Btn_RightUpMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_RightUpMouse.Style, imgRightUpMouse, true);
        }

        void Btn_RightMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_RightMouse.Style, imgRightMouse, true);
        }

        void Btn_RightDownMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_RightDownMouse.Style, imgRightDownMouse, true);
        }

        void Btn_RightDoubleClickMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_RightDoubleClickMouse.Style, imgRightDoubleClickMouse, true);
        }

        void Btn_RightClickMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_RightClickMouse.Style, imgRightClickMouse, true);
        }

        void Btn_RecycleMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_RecycleMouse.Style, imgRecycleMouse, true);
        }

        void Btn_OptionMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_OptionMouse.Style, imgOptionMouse, true);
        }

        void Btn_LeftUpMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_LeftUpMouse.Style, imgLeftUpMouse, true);
        }

        void Btn_LeftRightClickMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_LeftRightClickMouse.Style, imgLeftRightClickMouse, true);
        }

        void Btn_LeftMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_LeftMouse.Style, imgLeftMouse, true);
        }

        void Btn_LeftDownMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_LeftDownMouse.Style, imgLeftDownMouse, true);
        }


        void Btn_LeftDoubleClickMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_LeftDoubleClickMouse.Style, imgLeftDoubleClickMouse, true);
        }

        void Btn_LeftClickMouse_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_LeftClickMouse.Style, imgLeftClickMouse, true);
        }
        #endregion

        private void PreviewMonitor(string contents, Style style, Image tempimage, bool type)
        {
            Btn_Focus.TabIndex = 50;
            IsCurrentKeyboardClick = true;

            textPreviewLong.Text = null;
            textPreview.Text = null;
            Btn_PreView.Style = Btn_PreView.Style;

            imgPreView.Source = null;
            Canvas.SetTop(textPreview, 108);

            if (type)
            {
                textPreviewLong.Text = contents;
            }
            else if (contents.Equals("Space") || contents.Equals("Enter") || contents.Equals("Insert") || contents.Equals("Delete") || contents.Equals("Home") || contents.Equals("Macro"))
            {
                textPreview.FontSize = 60;
                
                textPreview.Text = contents;
                Canvas.SetTop(textPreview, Canvas.GetTop(textPreview) + 25);
            }
            else
            {
                textPreview.FontSize = 85;
                textPreview.Text = contents;
            }
            SelectedImage = tempimage;
            TempImage = tempimage;
            Btn_PreView.Style = style;
            imgPreView.Source = tempimage.Source; // 임마가 표시하는거
            
            if (!IsMouse)
                AddKeyBoardCurrentImageSrc();
            else
                AddMouseCurrentImageSrc();

            SerchMorseCode.SearchEnableMorseCodeImage();
        }

        private void PreviewMonitor(Image customMorseCode)
        {
            if (IsCurrentKeyboardClick)
            {
                TempImage.Source = customMorseCode.Source; //
                imgPreView.Source = customMorseCode.Source;
                if (!IsMouse)
                {
                    AddKeyBoardCurrentImageSrc();
                }
                else
                {
                    AddMouseCurrentImageSrc();
                }
                
                SerchMorseCode.SearchOverlapMorseCodeImage();
                SerchMorseCode.SearchEnableMorseCodeImage();
            }
            else
            {
				ErrorMessageBox messageBox = new ErrorMessageBox("선택을 해주세요");
				messageBox.ShowDialog();
                
            }
            
        }

        #region KeyBoardEvent
        void Btn_Option_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_Option.Style, imgMorseOption, true);
        }

        void Btn_WindowSize_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_WindowSize.Style, imgMorseWindowSize, true);
        }

        void Btn_Z_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Zㅋ", Btn_Z.Style, imgMorseZ,  false);
        }

        void Btn_Y_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Yㅛ", Btn_Y.Style, imgMorseY,  false);
        }

        void Btn_X_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Xㅌ", Btn_X.Style, imgMorseX,  false);
        }

        void Btn_Win_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_Win.Style, imgMorseWin, true);
        }

        void Btn_W_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Wㅈ", Btn_W.Style, imgMorseW,  false);
        }

        void Btn_V_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Vㅍ", Btn_Y.Style, imgMorseV,  false);
        }

        void Btn_Up_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("△", Btn_Up.Style, imgMorseUp, false);
        }

        void Btn_U_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Uㅕ", Btn_U.Style, imgMorseU, false);
        }

        void Btn_Tab_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Tab", Btn_Tab.Style, imgMorseTab, false);
        }

        void Btn_T_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Tㅅ", Btn_T.Style, imgMorseT, false);
        }

        void Btn_Space_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Space", Btn_Space.Style, imgMorseSpace, false);
        }

        void Btn_Shift_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Shift", Btn_Shift.Style, imgMorseShift, false);
        }

        void Btn_S_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Sㄴ", Btn_S.Style, imgMorseS, false);
        }

        void Btn_Right_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("▷", Btn_Right.Style, imgMorseRight, false);
        }

        void Btn_Recycle_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_Recycle.Style, imgMorseRecycle, true);
        }

        void Btn_R_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Rㄱ", Btn_R.Style, imgMorseR, false);
        }

        void Btn_Q_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Qㅂ", Btn_Q.Style, imgMorseQ, false);
        }

        void Btn_PreView_Click(object sender, RoutedEventArgs e)
        {
            
        }

        void Btn_PageUp_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_PageUp.Style, imgMorsePageUp, true);
        }

        void Btn_PageDown_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_PageDown.Style, imgMorsePageDown, true);
        }

        void Btn_P_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Pㅔ", Btn_P.Style, imgMorseP, false);
        }

        void Btn_O_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Oㅐ", Btn_O.Style, imgMorseO, false);
        }

        void Btn_Number_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("12#", Btn_Number.Style, imgMorseSpecial, false);
        }

        void Btn_N_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Nㅜ", Btn_N.Style, imgMorseN, false);
        }

        void Btn_Macro_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Macro", Btn_Macro.Style, imgMorseMacro, false);
        }

        void Btn_M_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Mㅡ", Btn_M.Style, imgMorseM, false);
        }

        void Btn_Left_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("◁", Btn_Left.Style, imgMorseLeft, false);

        }

        void Btn_L_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Lㅣ", Btn_L.Style, imgMorseL, false);

        }

        void Btn_K_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Kㅏ", Btn_K.Style, imgMorseK, false);

        }

        void Btn_J_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Jㅓ", Btn_J.Style, imgMorseJ, false);
        }

        void Btn_Insert_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Insert", Btn_Insert.Style, imgMorseInsert, false);
        }

        void Btn_I_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Iㅑ", Btn_Tab.Style, imgMorseI, false);
        }

        void Btn_Home_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Home", Btn_Home.Style, imgMorseHome, false);
        }

        void Btn_Hanja_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("한자", Btn_Hanja.Style, imgMorseHanja, false);
        }

        void Btn_HanEng_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("한영", Btn_HanEng.Style, imgMorseHanEng, false);
        }

        void Btn_H_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Hㅗ", Btn_H.Style, imgMorseH, false);
        }

        void Btn_G_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Gㅎ", Btn_G.Style, imgMorseG, false);
        }

        void Btn_Function_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Func", Btn_Function.Style, imgMorseFunction, false);
        }

        void Btn_F_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Fㄹ", Btn_F.Style, imgMorseF, false);
        }

        void Btn_Esc_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Esc", Btn_Esc.Style, imgMorseEsc, false);
        }

        void Btn_Enter_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Enter", Btn_Enter.Style, imgMorseEnter, false);
        }

        void Btn_End_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("End", Btn_End.Style, imgMorseEnd, false);
        }

        void Btn_E_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Eㄷ", Btn_E.Style, imgMorseE, false);
        }

        void Btn_Down_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("▽", Btn_Down.Style, imgMorseDown, false);
        }

        void Btn_Dot_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(".", Btn_Dot.Style, imgMorseDot, false);
        }

        void Btn_Delete_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Delete", Btn_Delete.Style, imgMorseDelete, false);
        }

        void Btn_D_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Dㅇ", Btn_D.Style, imgMorseD, false);
        }

        void Btn_Ctrl_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Ctrl", Btn_Ctrl.Style, imgMorseCtrl, false);
        }

        void Btn_Comma_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(",", Btn_Comma.Style, imgMorseComma, false);
        }

        void Btn_Close_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_Close.Style, imgMorseMain, true);
        }

        void Btn_CapsLock_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Caps", Btn_CapsLock.Style, imgMorseCaps, false);
        }

        void Btn_C_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Cㅊ", Btn_C.Style, imgMorseC, false);
        }

        void Btn_Back_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_Back.Style, imgMorseBackSpace, true);
        }

        void Btn_B_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Bㅠ", Btn_B.Style, imgMorseB, false);
        }

        void Btn_AutoComplete_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(null, Btn_AutoComplete.Style, imgMorseAutoComplete, true);
        }

        void Btn_Alt_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Alt", Btn_Alt.Style, imgMorseAlt, false);
        }

        void Btn_A_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor("Aㅁ", Btn_A.Style, imgMorseA, false);
        }
        #endregion

        #region CustomButtonEvent
        void Btn_61_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_61);
        }

        void Btn_60_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_60);
        }

        void Btn_59_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_59);
        }

        void Btn_58_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_58);
        }

        void Btn_57_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_57);
        }

        void Btn_56_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_56);
        }

        void Btn_55_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_55);
        }

        void Btn_54_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_54);
        }

        void Btn_53_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_53);
        }

        void Btn_52_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_52);
        }

        void Btn_51_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_51);
        }

        void Btn_50_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_50);
        }

        void Btn_49_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_49);
        }

        void Btn_48_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_48);
        }

        void Btn_47_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_47);
        }

        void Btn_46_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_46);
        }

        void Btn_45_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_45);
        }

        void Btn_44_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_44);
        }

        void Btn_43_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_43);
        }

        void Btn_42_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_42);
        }

        void Btn_41_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_41);
        }

        void Btn_40_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_40);
        }

        void Btn_39_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_39);
        }

        void Btn_38_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_38);
        }

        void Btn_37_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_37);
        }

        void Btn_36_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_36);
        }

        void Btn_35_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_35);
        }

        void Btn_34_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_34);
        }

        void Btn_33_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_33);
        }

        void Btn_32_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_32);
        }

        void Btn_31_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_31);
        }

        void Btn_30_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_30);
        }

        void Btn_29_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_29);
        }

        void Btn_28_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_28);
        }

        void Btn_27_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_27);
        }

        void Btn_26_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_26);
        }

        void Btn_25_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_25);
        }

        void Btn_24_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_24);
        }

        void Btn_23_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_23);
        }

        void Btn_22_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_22);
        }

        void Btn_21_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_21);
        }

        void Btn_20_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_20);
        }

        void Btn_19_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_19);
        }

        void Btn_18_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_18);
        }

        void Btn_17_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_17);
        }

        void Btn_16_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_16);
        }

        void Btn_15_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_15);
        }

        void Btn_14_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_14);
        }

        void Btn_13_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_13);
        }

        void Btn_12_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_12);
        }

        void Btn_11_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_11);
        }

        void Btn_10_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_10);
        }

        void Btn_9_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_9);
        }

        void Btn_8_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_8);
        }

        void Btn_7_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_7);
        }

        void Btn_6_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_6);
        }

        void Btn_5_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_5);
        }

        void Btn_4_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_4);
        }

        void Btn_3_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_3);
        }

        void Btn_2_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_2);
        }

        void Btn_1_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_1);
        }

        void Btn_0_Click(object sender, RoutedEventArgs e)
        {
            PreviewMonitor(img_0);
        }
        #endregion

        #region AddArrayList_Custom
        private void AddCustomMorseImageSrc()
        {
            MorseImage.Clear();

            MorseImage.Add(img_0.Source.ToString());
            MorseImage.Add(img_1.Source.ToString());
            MorseImage.Add(img_2.Source.ToString());
            MorseImage.Add(img_3.Source.ToString());
            MorseImage.Add(img_4.Source.ToString());
            MorseImage.Add(img_5.Source.ToString());
            MorseImage.Add(img_6.Source.ToString());
            MorseImage.Add(img_7.Source.ToString());
            MorseImage.Add(img_8.Source.ToString());
            MorseImage.Add(img_9.Source.ToString());
            MorseImage.Add(img_10.Source.ToString());
            MorseImage.Add(img_11.Source.ToString());
            MorseImage.Add(img_12.Source.ToString());
            MorseImage.Add(img_13.Source.ToString());
            MorseImage.Add(img_14.Source.ToString());
            MorseImage.Add(img_15.Source.ToString());
            MorseImage.Add(img_16.Source.ToString());
            MorseImage.Add(img_17.Source.ToString());
            MorseImage.Add(img_18.Source.ToString());
            MorseImage.Add(img_19.Source.ToString());
            MorseImage.Add(img_20.Source.ToString());
            MorseImage.Add(img_21.Source.ToString());
            MorseImage.Add(img_22.Source.ToString());
            MorseImage.Add(img_23.Source.ToString());
            MorseImage.Add(img_24.Source.ToString());
            MorseImage.Add(img_25.Source.ToString());
            MorseImage.Add(img_26.Source.ToString());
            MorseImage.Add(img_27.Source.ToString());
            MorseImage.Add(img_28.Source.ToString());
            MorseImage.Add(img_29.Source.ToString());
            MorseImage.Add(img_30.Source.ToString());
            MorseImage.Add(img_31.Source.ToString());
            MorseImage.Add(img_32.Source.ToString());
            MorseImage.Add(img_33.Source.ToString());
            MorseImage.Add(img_34.Source.ToString());
            MorseImage.Add(img_35.Source.ToString());
            MorseImage.Add(img_36.Source.ToString());
            MorseImage.Add(img_37.Source.ToString());
            MorseImage.Add(img_38.Source.ToString());
            MorseImage.Add(img_39.Source.ToString());
            MorseImage.Add(img_40.Source.ToString());
            MorseImage.Add(img_41.Source.ToString());
            MorseImage.Add(img_42.Source.ToString());
            MorseImage.Add(img_43.Source.ToString());
            MorseImage.Add(img_44.Source.ToString());
            MorseImage.Add(img_45.Source.ToString());
            MorseImage.Add(img_46.Source.ToString());
            MorseImage.Add(img_47.Source.ToString());
            MorseImage.Add(img_48.Source.ToString());
            MorseImage.Add(img_49.Source.ToString());
            MorseImage.Add(img_50.Source.ToString());
            MorseImage.Add(img_51.Source.ToString());
            MorseImage.Add(img_52.Source.ToString());
            MorseImage.Add(img_53.Source.ToString());
            MorseImage.Add(img_54.Source.ToString());
            MorseImage.Add(img_55.Source.ToString());
            MorseImage.Add(img_56.Source.ToString());
            MorseImage.Add(img_57.Source.ToString());
            MorseImage.Add(img_58.Source.ToString());
            MorseImage.Add(img_59.Source.ToString());
            MorseImage.Add(img_60.Source.ToString());
            MorseImage.Add(img_61.Source.ToString());

            SerchMorseCode.AddMorseImage(this.MorseImage);

        }

        private void AddCustomButton()
        {
            CustomButton.Clear();

            CustomButton.Add(Btn_0);
            CustomButton.Add(Btn_1);
            CustomButton.Add(Btn_2);
            CustomButton.Add(Btn_3);
            CustomButton.Add(Btn_4);
            CustomButton.Add(Btn_5);
            CustomButton.Add(Btn_6);
            CustomButton.Add(Btn_7);
            CustomButton.Add(Btn_8);
            CustomButton.Add(Btn_9);
            CustomButton.Add(Btn_10);
            CustomButton.Add(Btn_11);
            CustomButton.Add(Btn_12);
            CustomButton.Add(Btn_13);
            CustomButton.Add(Btn_14);
            CustomButton.Add(Btn_15);
            CustomButton.Add(Btn_16);
            CustomButton.Add(Btn_17);
            CustomButton.Add(Btn_18);
            CustomButton.Add(Btn_19);
            CustomButton.Add(Btn_20);
            CustomButton.Add(Btn_21);
            CustomButton.Add(Btn_22);
            CustomButton.Add(Btn_23);
            CustomButton.Add(Btn_24);
            CustomButton.Add(Btn_25);
            CustomButton.Add(Btn_26);
            CustomButton.Add(Btn_27);
            CustomButton.Add(Btn_28);
            CustomButton.Add(Btn_29);
            CustomButton.Add(Btn_30);
            CustomButton.Add(Btn_31);
            CustomButton.Add(Btn_32);
            CustomButton.Add(Btn_33);
            CustomButton.Add(Btn_34);
            CustomButton.Add(Btn_35);
            CustomButton.Add(Btn_36);
            CustomButton.Add(Btn_37);
            CustomButton.Add(Btn_38);
            CustomButton.Add(Btn_39);
            CustomButton.Add(Btn_40);
            CustomButton.Add(Btn_41);
            CustomButton.Add(Btn_42);
            CustomButton.Add(Btn_43);
            CustomButton.Add(Btn_44);
            CustomButton.Add(Btn_45);
            CustomButton.Add(Btn_46);
            CustomButton.Add(Btn_47);
            CustomButton.Add(Btn_48);
            CustomButton.Add(Btn_49);
            CustomButton.Add(Btn_50);
            CustomButton.Add(Btn_51);
            CustomButton.Add(Btn_52);
            CustomButton.Add(Btn_53);
            CustomButton.Add(Btn_54);
            CustomButton.Add(Btn_55);
            CustomButton.Add(Btn_56);
            CustomButton.Add(Btn_57);
            CustomButton.Add(Btn_58);
            CustomButton.Add(Btn_59);
            CustomButton.Add(Btn_60);
            CustomButton.Add(Btn_61);

            SerchMorseCode.AddButton(this.CustomButton);
        }
        #endregion // 커스텀 버튼과 이미지를 저장하는 어레이 리스트

        #region AddArrayList_KeyBoard
        private void AddKeyBoardCurrentImageSrc()
        {
            SetImage.Clear(); // 어레이 리스트 다 지우고

            SetImage.Add(imgMorseA.Source.ToString());
            SetImage.Add(imgMorseAlt.Source.ToString());
            SetImage.Add(imgMorseAutoComplete.Source.ToString());
            SetImage.Add(imgMorseB.Source.ToString());
            SetImage.Add(imgMorseBackSpace.Source.ToString());
            SetImage.Add(imgMorseC.Source.ToString());
            SetImage.Add(imgMorseCaps.Source.ToString());
            SetImage.Add(imgMorseComma.Source.ToString());
            SetImage.Add(imgMorseCtrl.Source.ToString());
            SetImage.Add(imgMorseD.Source.ToString());
            SetImage.Add(imgMorseDelete.Source.ToString());
            SetImage.Add(imgMorseDot.Source.ToString());
            SetImage.Add(imgMorseDown.Source.ToString());
            SetImage.Add(imgMorseE.Source.ToString());
            SetImage.Add(imgMorseEnd.Source.ToString());
            SetImage.Add(imgMorseEnter.Source.ToString());
            SetImage.Add(imgMorseEsc.Source.ToString());
            SetImage.Add(imgMorseF.Source.ToString());
            SetImage.Add(imgMorseFunction.Source.ToString());
            SetImage.Add(imgMorseG.Source.ToString());
            SetImage.Add(imgMorseH.Source.ToString());
            SetImage.Add(imgMorseHanEng.Source.ToString());
            SetImage.Add(imgMorseHanja.Source.ToString());
            SetImage.Add(imgMorseHome.Source.ToString());
            SetImage.Add(imgMorseI.Source.ToString());
            SetImage.Add(imgMorseInsert.Source.ToString());
            SetImage.Add(imgMorseJ.Source.ToString());
            SetImage.Add(imgMorseK.Source.ToString());
            SetImage.Add(imgMorseL.Source.ToString());
            SetImage.Add(imgMorseLeft.Source.ToString());
            SetImage.Add(imgMorseM.Source.ToString());
            SetImage.Add(imgMorseMacro.Source.ToString());
            SetImage.Add(imgMorseMain.Source.ToString());
            SetImage.Add(imgMorseN.Source.ToString());
            SetImage.Add(imgMorseO.Source.ToString());
            SetImage.Add(imgMorseP.Source.ToString());
            SetImage.Add(imgMorsePageDown.Source.ToString());
            SetImage.Add(imgMorsePageUp.Source.ToString());
            SetImage.Add(imgMorseQ.Source.ToString());
            SetImage.Add(imgMorseR.Source.ToString());
            SetImage.Add(imgMorseRecycle.Source.ToString());
            SetImage.Add(imgMorseRight.Source.ToString());
            SetImage.Add(imgMorseS.Source.ToString());
            SetImage.Add(imgMorseShift.Source.ToString());
            SetImage.Add(imgMorseSpace.Source.ToString());
            SetImage.Add(imgMorseSpecial.Source.ToString());
            SetImage.Add(imgMorseT.Source.ToString());
            SetImage.Add(imgMorseTab.Source.ToString());
            SetImage.Add(imgMorseU.Source.ToString());
            SetImage.Add(imgMorseUp.Source.ToString());
            SetImage.Add(imgMorseV.Source.ToString());
            SetImage.Add(imgMorseW.Source.ToString());
            SetImage.Add(imgMorseWin.Source.ToString());
            SetImage.Add(imgMorseWindowSize.Source.ToString());
            SetImage.Add(imgMorseX.Source.ToString());
            SetImage.Add(imgMorseY.Source.ToString());
            SetImage.Add(imgMorseZ.Source.ToString());
			SetImage.Add(imgMorseOption.Source.ToString());
			SetImage.Add(imgMorseHidden.Source.ToString());
			
            SerchMorseCode.AddSetImage(this.SetImage);
        }

        private void AddKeyBoardCurrentImage()
        {
            CurrentImage.Clear(); // 어레이 리스트 다 지우고

            CurrentImage.Add(imgMorseA);
            CurrentImage.Add(imgMorseAlt);
            CurrentImage.Add(imgMorseAutoComplete);
            CurrentImage.Add(imgMorseB);
            CurrentImage.Add(imgMorseBackSpace);
            CurrentImage.Add(imgMorseC);
            CurrentImage.Add(imgMorseCaps);
            CurrentImage.Add(imgMorseComma);
            CurrentImage.Add(imgMorseCtrl);
            CurrentImage.Add(imgMorseD);
            CurrentImage.Add(imgMorseDelete);
            CurrentImage.Add(imgMorseDot);
            CurrentImage.Add(imgMorseDown);
            CurrentImage.Add(imgMorseE);
            CurrentImage.Add(imgMorseEnd);
            CurrentImage.Add(imgMorseEnter);
            CurrentImage.Add(imgMorseEsc);
            CurrentImage.Add(imgMorseF);
            CurrentImage.Add(imgMorseFunction);
            CurrentImage.Add(imgMorseG);
            CurrentImage.Add(imgMorseH);
            CurrentImage.Add(imgMorseHanEng);
            CurrentImage.Add(imgMorseHanja);
            CurrentImage.Add(imgMorseHome);
            CurrentImage.Add(imgMorseI);
            CurrentImage.Add(imgMorseInsert);
            CurrentImage.Add(imgMorseJ);
            CurrentImage.Add(imgMorseK);
            CurrentImage.Add(imgMorseL);
            CurrentImage.Add(imgMorseLeft);
            CurrentImage.Add(imgMorseM);
            CurrentImage.Add(imgMorseMacro);
            CurrentImage.Add(imgMorseMain);
            CurrentImage.Add(imgMorseN);
            CurrentImage.Add(imgMorseO);
            CurrentImage.Add(imgMorseP);
            CurrentImage.Add(imgMorsePageDown);
            CurrentImage.Add(imgMorsePageUp);
            CurrentImage.Add(imgMorseQ);
            CurrentImage.Add(imgMorseR);
            CurrentImage.Add(imgMorseRecycle);
            CurrentImage.Add(imgMorseRight);
            CurrentImage.Add(imgMorseS);
            CurrentImage.Add(imgMorseShift);
            CurrentImage.Add(imgMorseSpace);
            CurrentImage.Add(imgMorseSpecial);
            CurrentImage.Add(imgMorseT);
            CurrentImage.Add(imgMorseTab);
            CurrentImage.Add(imgMorseU);
            CurrentImage.Add(imgMorseUp);
            CurrentImage.Add(imgMorseV);
            CurrentImage.Add(imgMorseW);
            CurrentImage.Add(imgMorseWin);
            CurrentImage.Add(imgMorseWindowSize);
            CurrentImage.Add(imgMorseX);
            CurrentImage.Add(imgMorseY);
            CurrentImage.Add(imgMorseZ);
            CurrentImage.Add(imgMorseOption);
			CurrentImage.Add(imgMorseHidden);
        }

        private void AddKeyBoardCurrentButton()
        {
            CurrentButton.Clear();
            //57개 키
            CurrentButton.Add(Btn_A);
            CurrentButton.Add(Btn_Alt);
            CurrentButton.Add(Btn_AutoComplete);
            CurrentButton.Add(Btn_B);
            CurrentButton.Add(Btn_Back);
            CurrentButton.Add(Btn_C);
            CurrentButton.Add(Btn_CapsLock);
            CurrentButton.Add(Btn_Comma);
            CurrentButton.Add(Btn_Ctrl);
            CurrentButton.Add(Btn_D);
            CurrentButton.Add(Btn_Delete);
            CurrentButton.Add(Btn_Dot);
            CurrentButton.Add(Btn_Down);
            CurrentButton.Add(Btn_E);
            CurrentButton.Add(Btn_End);
            CurrentButton.Add(Btn_Enter);
            CurrentButton.Add(Btn_Esc);
            CurrentButton.Add(Btn_F);
            CurrentButton.Add(Btn_Function);
            CurrentButton.Add(Btn_G);
            CurrentButton.Add(Btn_H);
            CurrentButton.Add(Btn_HanEng);
            CurrentButton.Add(Btn_Hanja);
            CurrentButton.Add(Btn_Home);
            CurrentButton.Add(Btn_I);
            CurrentButton.Add(Btn_Insert);
            CurrentButton.Add(Btn_J);
            CurrentButton.Add(Btn_K);
            CurrentButton.Add(Btn_L);
            CurrentButton.Add(Btn_Left);
            CurrentButton.Add(Btn_M);
            CurrentButton.Add(Btn_Macro);
            CurrentButton.Add(Btn_Close);
            CurrentButton.Add(Btn_N);
            CurrentButton.Add(Btn_O);
            CurrentButton.Add(Btn_P);
            CurrentButton.Add(Btn_PageDown);
            CurrentButton.Add(Btn_PageUp);
            CurrentButton.Add(Btn_Q);
            CurrentButton.Add(Btn_R);
            CurrentButton.Add(Btn_Recycle);
            CurrentButton.Add(Btn_Right);
            CurrentButton.Add(Btn_S);
            CurrentButton.Add(Btn_Shift);
            CurrentButton.Add(Btn_Space);
            CurrentButton.Add(Btn_Number);
            CurrentButton.Add(Btn_T);
            CurrentButton.Add(Btn_Tab);
            CurrentButton.Add(Btn_U);
            CurrentButton.Add(Btn_Up);
            CurrentButton.Add(Btn_V);
            CurrentButton.Add(Btn_W);
            CurrentButton.Add(Btn_Win);
            CurrentButton.Add(Btn_WindowSize);
            CurrentButton.Add(Btn_X);
            CurrentButton.Add(Btn_Y);
            CurrentButton.Add(Btn_Z);
			CurrentButton.Add(Btn_Option);
			

            SerchMorseCode.AddCurrentButton(this.CurrentButton);
        }
        #endregion // 키보드 버튼과 이미지를 저장하는 어레이 리스트

        #region AddArrayList_Mouse 
        private void AddMouseCurrentImageSrc()
        {
            SetImage.Clear(); // 어레이 리스트 다 지우고
            //20개 이미지
            SetImage.Add(imgBackMainMouse.Source.ToString());
            SetImage.Add(imgDevideMouse.Source.ToString());
            SetImage.Add(imgDownMouse.Source.ToString());
            SetImage.Add(imgDragMouse.Source.ToString());
            SetImage.Add(imgLeftClickMouse.Source.ToString());
            SetImage.Add(imgLeftDoubleClickMouse.Source.ToString());
            SetImage.Add(imgLeftDownMouse.Source.ToString());
            SetImage.Add(imgLeftMouse.Source.ToString());
            SetImage.Add(imgLeftRightClickMouse.Source.ToString());
            SetImage.Add(imgLeftUpMouse.Source.ToString());
            SetImage.Add(imgOptionMouse.Source.ToString());
            SetImage.Add(imgRecycleMouse.Source.ToString());
            SetImage.Add(imgRightClickMouse.Source.ToString());
            SetImage.Add(imgRightDoubleClickMouse.Source.ToString());
            SetImage.Add(imgRightDownMouse.Source.ToString());
            SetImage.Add(imgRightMouse.Source.ToString());
            SetImage.Add(imgRightUpMouse.Source.ToString());
            SetImage.Add(imgUpMouse.Source.ToString());
            SetImage.Add(imgWheelDownMouse.Source.ToString());
            SetImage.Add(imgWheelUpMouse.Source.ToString());
			SetImage.Add(imgHiddenMouse.Source.ToString());
			SetImage.Add(imgMorseOptionMouse.Source.ToString());

            SetImage.Add((imgExpAdressMouse.Source.ToString()));
            SetImage.Add((imgExpBackMouse.Source.ToString()));
            SetImage.Add((imgExpColseMouse.Source.ToString()));
            SetImage.Add((imgExpDecreaseMouse.Source.ToString()));
            SetImage.Add((imgExpFavoriteMouse.Source.ToString()));
            SetImage.Add((imgExpIncreaseMouse.Source.ToString()));
            SetImage.Add((imgExpNewExpMouse.Source.ToString()));
            SetImage.Add((imgExpNextMouse.Source.ToString()));
            SetImage.Add((imgExpOptionMouse.Source.ToString()));
            SetImage.Add((imgExpRefleshMouse.Source.ToString()));
            SetImage.Add((imgExpStartMouse.Source.ToString()));
            SetImage.Add((imgChangeWindowSizeMouse.Source.ToString()));
			
            SerchMorseCode.AddSetImage(this.SetImage);
        }

        private void AddMouseCurrentImage()
        {
            CurrentImage.Clear(); // 어레이 리스트 다 지우고
            //20개 이미지
            CurrentImage.Add(imgBackMainMouse);
            CurrentImage.Add(imgDevideMouse);
            CurrentImage.Add(imgDownMouse);
            CurrentImage.Add(imgDragMouse);
            CurrentImage.Add(imgLeftClickMouse);
            CurrentImage.Add(imgLeftDoubleClickMouse);
            CurrentImage.Add(imgLeftDownMouse);
            CurrentImage.Add(imgLeftMouse);
            CurrentImage.Add(imgLeftRightClickMouse);
            CurrentImage.Add(imgLeftUpMouse);
            CurrentImage.Add(imgOptionMouse);
            CurrentImage.Add(imgRecycleMouse);
            CurrentImage.Add(imgRightClickMouse);
            CurrentImage.Add(imgRightDoubleClickMouse);
            CurrentImage.Add(imgRightDownMouse);
            CurrentImage.Add(imgRightMouse);
            CurrentImage.Add(imgRightUpMouse);
            CurrentImage.Add(imgUpMouse);
            CurrentImage.Add(imgWheelDownMouse);
            CurrentImage.Add(imgWheelUpMouse);
			CurrentImage.Add(imgHiddenMouse);
			CurrentImage.Add(imgMorseOptionMouse);

            CurrentImage.Add(imgExpAdressMouse);
            CurrentImage.Add(imgExpBackMouse);
            CurrentImage.Add(imgExpColseMouse);
            CurrentImage.Add(imgExpDecreaseMouse);
            CurrentImage.Add(imgExpFavoriteMouse);
            CurrentImage.Add(imgExpIncreaseMouse);
            CurrentImage.Add(imgExpNewExpMouse);
            CurrentImage.Add(imgExpNextMouse);
            CurrentImage.Add(imgExpOptionMouse);
            CurrentImage.Add(imgExpRefleshMouse);
            CurrentImage.Add(imgExpStartMouse);
            CurrentImage.Add(imgChangeWindowSizeMouse);
        }

        private void AddMouseCurrentButton()
        {
            CurrentButton.Clear();
            //57개 키
            CurrentButton.Add(Btn_BackMainMouse);
            CurrentButton.Add(Btn_DevideMouse);
            CurrentButton.Add(Btn_DownMouse);
            CurrentButton.Add(Btn_DragMouse);
            CurrentButton.Add(Btn_LeftClickMouse);
            CurrentButton.Add(Btn_LeftDoubleClickMouse);
            CurrentButton.Add(Btn_LeftDownMouse);
            CurrentButton.Add(Btn_LeftMouse);
            CurrentButton.Add(Btn_LeftRightClickMouse);
            CurrentButton.Add(Btn_LeftUpMouse);
            CurrentButton.Add(Btn_OptionMouse);
            CurrentButton.Add(Btn_RecycleMouse);
            CurrentButton.Add(Btn_RightClickMouse);
            CurrentButton.Add(Btn_RightDoubleClickMouse);
            CurrentButton.Add(Btn_RightDownMouse);
            CurrentButton.Add(Btn_RightMouse);
            CurrentButton.Add(Btn_RightUpMouse);
            CurrentButton.Add(Btn_UpMouse);
            CurrentButton.Add(Btn_WheelDownMouse);
            CurrentButton.Add(Btn_WheelUpMouse);
            CurrentButton.Add(Btn_WheelUpMouse);
            CurrentButton.Add(Btn_OptionMorseMouse);

            CurrentButton.Add(Btn_ExpAddressMouse);
            CurrentButton.Add(Btn_ExpBackMouse);
            CurrentButton.Add(Btn_ExpCloseMouse);
            CurrentButton.Add(Btn_ExpDecreaseMouse);
            CurrentButton.Add(Btn_ExpFavoriteMouse);
            CurrentButton.Add(Btn_ExpIncreaseMouse);
            CurrentButton.Add(Btn_ExpNewMouse);
            CurrentButton.Add(Btn_ExpNextMouse);
            CurrentButton.Add(Btn_ExpOptionMouse);
            CurrentButton.Add(Btn_ExpRefleshMouse);
            CurrentButton.Add(Btn_ExpStartMouse);
            CurrentButton.Add(Btn_WindowSizeMouse);

            SerchMorseCode.AddCurrentButton(this.CurrentButton);
        }

        private void Btn_Exit_Click(object sender, System.Windows.RoutedEventArgs e)
        {
        	 this.Close();
        }

        private void Btn_OptionMorseMouse_Click(object sender, System.Windows.RoutedEventArgs e)
        {
        		PreviewMonitor(null, Btn_OptionMorseMouse.Style, imgMorseOptionMouse, true);
        }

        private void Btn_CloseWindow_Click(object sender, System.Windows.RoutedEventArgs e)
        {
        	   this.Close();
        }

        
        #endregion // 마우스 버튼과 이미지를 저장하는 어레이 리스트
    }
}